﻿@using KRM.Core
@model KRM.Core.tblProductOption
@{
    var productOptionAvailability = new KRMEntities().vProductOptionAvailabilities.FirstOrDefault(a => a.ProductOptionID == Model.ProductOptionID);
}
<fieldset>
    <legend>INFORMATION</legend>
    <p>The following Information may need passing onto the customer</p>
    <p style="color: blue">External Dimensions:</p>
    <p style="color: RoyalBlue; font-weight: bold">@ViewBag.exCm</p>
    <p style="color: Olive; font-weight: bold; margin-bottom: 10px;">@ViewBag.exInch</p>

    <p style="color: blue">Internal Dimensions:</p>
    <p style="color: RoyalBlue; font-weight: bold">@ViewBag.inCm</p>
    <p style="color: Olive; font-weight: bold; margin-bottom: 10px;">@ViewBag.inInch</p>
</fieldset>
<fieldset>
    <legend>SERVICES</legend>
    <input type="hidden" id="hfProductOptionId" value="@Model.ProductOptionID"/>
    <div class="row-fluid">
        @if (Model.HasService())
        {
            <div class="span3">Enter Postcode:</div>
            <div class="span3">
                <input type="text" class="input-block-level" id="postcodeService" />
            </div>
            <div class="span3">
                <input type="button" class="btn btn-primary" value="Check" onclick="checkpostcodeservice()"  />
            </div>
        }
        else
        {
            <p>The product option doesn't have any service</p>
        }
    </div>
    <div class="row-fluid assemblyservice">
        <div class="span8 assemblyname" style="color: green; font-weight: bold">
            
        </div>
        <div class="span4 text-right"><input type="button" value="Add Assembly Service" class="btn btn-primary" onclick="addassemblyservice()"/></div>
    </div>
</fieldset>

@if (productOptionAvailability != null)
{
    if (productOptionAvailability.Availability != null && (productOptionAvailability.Availability.Value < 1 && productOptionAvailability.Availability.HasValue))
    {
    <script>
            alert("No stock, advise customer of due date if there is one");
    </script>
    }
    else if (productOptionAvailability.Availability != null && (productOptionAvailability.Availability.Value < 1 && !productOptionAvailability.Availability.HasValue))
    {
    <script>
            alert("This Item is Direct Despatch");
    </script>
    }
}
